<%@page import="cdp.Relatorio"%>
<%@page import="java.util.List"%>
<%@page import="cdp.Produto"%>
<%
    String raiz = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath();
%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>XMLs</title>
        <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
        <link href="<%=raiz%>/css/admin/prettify.css" type="text/css" rel="stylesheet" />
        <script type="text/javascript" src="<%=raiz%>/js/admin/prettify.js"></script>
        <script>(function () {
  var sourceBaseUrl = /[&?]distrib/.test(location.search)
      ? "../distrib/google-code-prettify/" : "../src/";
  var sources = [
      "prettify.js",
      "lang-css.js",
      "lang-go.js",
      "lang-hs.js",
      "lang-lisp.js",
      "lang-lua.js",
      "lang-ml.js",
      "lang-proto.js",
      "lang-scala.js",
      "lang-sql.js",
      "lang-wiki.js",
      "lang-vhdl.js",
      "lang-vb.js",
      "lang-yaml.js",
  ];
  var styles = [
      "prettify.css"
  ];
  if (window.console) {
    console.log("sourceBaseUrl=" + sourceBaseUrl);
  }
  for (var i = 0; i < sources.length; ++i) {
    document.write(
        "<script src=\"" + sourceBaseUrl + sources[i] + "\"><\/script>");
  }
  for (var i = 0; i < styles.length; ++i) {
    document.write(
        "<link rel=\"stylesheet\" href=\"" + sourceBaseUrl + styles[i] + "\">");
  }
})();
</script>
    </head>
    <body onload="prettyPrint()">
        <pre class="prettyprint" id="xml">
            &lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
            &lt;lista_produtos&gt;
                <%
                    List<Relatorio> listaRelatorios = (List<Relatorio>) request.getAttribute("listaRelatorios");
                    for (Relatorio relatorio : listaRelatorios) {
                %>
                &lt;produto&gt;
                    &lt;nome><%=relatorio.getProduto().getNome()%>&lt;/nome&gt;
                    &lt;quantidade&gt;<%=relatorio.getQuantidade()%>&lt;/quantidade&gt;
                    &lt;marca&gt;<%=relatorio.getProduto().getMarca().getNome()%>&lt;/marca&gt;
                    &lt;email_marca&gt;<%=relatorio.getProduto().getMarca().getEmail()%>&lt;/email_marca&gt;
                &lt;/produto&gt;                
                <%}%>
            &lt;/lista_produtos&gt;
        </pre
       
    </body>
</html>
